package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionPhbMapper;
import com.ruoyi.net.domain.ElementQosActionPhb;
import com.ruoyi.net.service.IElementQosActionPhbService;

/**
 * 网元-QOS配置-流行为-指配PHB配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionPhbServiceImpl implements IElementQosActionPhbService 
{
    @Autowired
    private ElementQosActionPhbMapper elementQosActionPhbMapper;

    /**
     * 查询网元-QOS配置-流行为-指配PHB配置
     * 
     * @param id 网元-QOS配置-流行为-指配PHB配置主键
     * @return 网元-QOS配置-流行为-指配PHB配置
     */
    @Override
    public ElementQosActionPhb selectElementQosActionPhbById(String id)
    {
        return elementQosActionPhbMapper.selectElementQosActionPhbById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-指配PHB配置列表
     * 
     * @param elementQosActionPhb 网元-QOS配置-流行为-指配PHB配置
     * @return 网元-QOS配置-流行为-指配PHB配置
     */
    @Override
    public List<ElementQosActionPhb> selectElementQosActionPhbList(ElementQosActionPhb elementQosActionPhb)
    {
        return elementQosActionPhbMapper.selectElementQosActionPhbList(elementQosActionPhb);
    }

    /**
     * 新增网元-QOS配置-流行为-指配PHB配置
     * 
     * @param elementQosActionPhb 网元-QOS配置-流行为-指配PHB配置
     * @return 结果
     */
    @Override
    public int insertElementQosActionPhb(ElementQosActionPhb elementQosActionPhb)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionPhb.getId())) {
            elementQosActionPhb.setId(uuid);
        }
        elementQosActionPhb.setCreateBy(SecurityUtils.getUsername());
        elementQosActionPhb.setCreateTime(DateUtils.getNowDate());
        elementQosActionPhb.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionPhb.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionPhbMapper.insertElementQosActionPhb(elementQosActionPhb);
    }

    /**
     * 修改网元-QOS配置-流行为-指配PHB配置
     * 
     * @param elementQosActionPhb 网元-QOS配置-流行为-指配PHB配置
     * @return 结果
     */
    @Override
    public int updateElementQosActionPhb(ElementQosActionPhb elementQosActionPhb)
    {
        elementQosActionPhb.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionPhb.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionPhbMapper.updateElementQosActionPhb(elementQosActionPhb);
    }

    /**
     * 批量删除网元-QOS配置-流行为-指配PHB配置
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-指配PHB配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionPhbByIds(String[] ids)
    {
        return elementQosActionPhbMapper.deleteElementQosActionPhbByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-指配PHB配置信息
     * 
     * @param id 网元-QOS配置-流行为-指配PHB配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionPhbById(String id)
    {
        return elementQosActionPhbMapper.deleteElementQosActionPhbById(id);
    }
}
